<template>
  <div class="strict_detail_container">
    <div
      class="strict_detail_item"
      v-for="item in strictdetail"
      :key="item.id"
      @click="gospecial(item.id)"
    >
      <img :src="item.pic" alt="" />
      <div class="strict_detail_content">
        <p class="strict_detail_one">{{ item.title }}</p>
        <p class="strict_detail_two">{{ item.descript }}</p>
        <p class="strict_detail_three">查看详情</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      strictdetail: [],
    };
  },
  mounted() {
    this.$API.getdetail().then((res) => {
      console.log(res);
      this.strictdetail = res.data.data;
    });
  },
  methods: {
    gospecial(id) {
      this.$router.push({
        path: "/specialdetail",
        query:{
          id
        }
      });
    },
  },
};
</script>

<style scoped>
.strict_detail_container {
  width: 100%;
}
.strict_detail_item {
  width: 100%;
  height: 4rem;
  background-color: yellowgreen;
  margin-top: 0.2rem;
  display: flex;
  justify-content: center;
  position: relative;
}
.strict_detail_item img {
  width: 100%;
  height: 100%;
}
.strict_detail_content {
  width: 5rem;
  height: 2rem;
  text-align: center;
  position: absolute;
  top: 1rem;
  color: white;
}
.strict_detail_one {
  /* font-size: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; */
  font-size: 0.4rem;
  color: white;
  margin-top: 0.2rem;
  width: 4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strict_detail_two {
  font-size: 0.3rem;
  color: white;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strict_detail_three {
  width: 1.5rem;
  height: 0.5rem;
  border: 1px solid white;
  border-radius: 0.5rem;
  margin-left: 1.2rem;
}
</style>